import { App } from 'vue'

import {
  createFromIconfontCN,
  AppstoreOutlined,
  MenuUnfoldOutlined,
  MenuFoldOutlined,
  UserOutlined,
  LockOutlined,
  HomeOutlined,
  SyncOutlined,
  ColumnHeightOutlined,
  SettingOutlined,
  ReloadOutlined,
  MailOutlined,
  SelectOutlined,
  UpOutlined,
  DownOutlined,
  TeamOutlined,
  ReconciliationOutlined,
  UploadOutlined,
  PlusOutlined,
  AppstoreAddOutlined,
  FormOutlined,
  UndoOutlined,
  SearchOutlined,
  PlusSquareOutlined,
  TagsOutlined,
  DeleteOutlined,
  AlertOutlined,
  SolutionOutlined,
  SwitcherOutlined,
  PushpinOutlined,
  ApartmentOutlined,
  KeyOutlined,
  BugOutlined,
  ContainerOutlined,
  UserSwitchOutlined,
  ClockCircleOutlined,
  VerticalAlignBottomOutlined,
  VerticalAlignTopOutlined,
  ControlOutlined,
  ApiOutlined,
  BarsOutlined,
  QqOutlined,
  DollarCircleOutlined,
  BuildOutlined,
  FileAddOutlined,
} from '@ant-design/icons-vue'

export function registerAntdIcons(app: App) {
  // iconfont
  const IconFont = createFromIconfontCN({
    scriptUrl: '//at.alicdn.com/t/font_2634598_yhpt8v7ayr.js',
  })
  app.component('IconFont', IconFont)

  // icons
  app
    .component(AppstoreOutlined.displayName, AppstoreOutlined)
    .component(MenuUnfoldOutlined.displayName, MenuUnfoldOutlined)
    .component(MenuFoldOutlined.displayName, MenuFoldOutlined)
    .component(UserOutlined.displayName, UserOutlined)
    .component(LockOutlined.displayName, LockOutlined)
    .component(HomeOutlined.displayName, HomeOutlined)
    .component(SyncOutlined.displayName, SyncOutlined)
    .component(ColumnHeightOutlined.displayName, ColumnHeightOutlined)
    .component(SettingOutlined.displayName, SettingOutlined)
    .component(ReloadOutlined.displayName, ReloadOutlined)
    .component(MailOutlined.displayName, MailOutlined)
    .component(SelectOutlined.displayName, SelectOutlined)
    .component(UpOutlined.displayName, UpOutlined)
    .component(DownOutlined.displayName, DownOutlined)
    .component(TeamOutlined.displayName, TeamOutlined)
    .component(ReconciliationOutlined.displayName, ReconciliationOutlined)
    .component(UploadOutlined.displayName, UploadOutlined)
    .component(PlusOutlined.displayName, PlusOutlined)
    .component(AppstoreAddOutlined.displayName, AppstoreAddOutlined)
    .component(FormOutlined.displayName, FormOutlined)
    .component(UndoOutlined.displayName, UndoOutlined)
    .component(SearchOutlined.displayName, SearchOutlined)
    .component(PlusSquareOutlined.displayName, PlusSquareOutlined)
    .component(TagsOutlined.displayName, TagsOutlined)
    .component(DeleteOutlined.displayName, DeleteOutlined)
    .component(AlertOutlined.displayName, AlertOutlined)
    .component(SolutionOutlined.displayName, SolutionOutlined)
    .component(SwitcherOutlined.displayName, SwitcherOutlined)
    .component(PushpinOutlined.displayName, PushpinOutlined)
    .component(ApartmentOutlined.displayName, ApartmentOutlined)
    .component(KeyOutlined.displayName, KeyOutlined)
    .component(BugOutlined.displayName, BugOutlined)
    .component(ContainerOutlined.displayName, ContainerOutlined)
    .component(UserSwitchOutlined.displayName, UserSwitchOutlined)
    .component(ClockCircleOutlined.displayName, ClockCircleOutlined)
    .component(
      VerticalAlignBottomOutlined.displayName,
      VerticalAlignBottomOutlined
    )
    .component(VerticalAlignTopOutlined.displayName, VerticalAlignTopOutlined)
    .component(ControlOutlined.displayName, ControlOutlined)
    .component(ApiOutlined.displayName, ApiOutlined)
    .component(BarsOutlined.displayName, BarsOutlined)
    .component(QqOutlined.displayName, QqOutlined)
    .component(DollarCircleOutlined.displayName, DollarCircleOutlined)
    .component(BuildOutlined.displayName, BuildOutlined)
    .component(FileAddOutlined.displayName, FileAddOutlined)
}

export const iconNameList: string[] = [
  'appstore-outlined',
  'menu-unfold-outlined',
  'menu-fold-outlined',
  'user-outlined',
  'lock-outlined',
  'home-outlined',
  'sync-outlined',
  'column-height-outlined',
  'setting-outlined',
  'reload-outlined',
  'mail-outlined',
  'select-outlined',
  'up-outlined',
  'down-outlined',
  'team-outlined',
  'reconciliation-outlined',
  'upload-outlined',
  'plus-outlined',
  'appstore-add-outlined',
  'form-outlined',
  'undo-outlined',
  'search-outlined',
  'plus-square-outlined',
  'tags-outlined',
  'delete-outlined',
  'alert-outlined',
  'solution-outlined',
  'switcher-outlined',
  'pushpin-outlined',
  'apartment-outlined',
  'key-outlined',
  'bug-outlined',
  'container-outlined',
  'user-switch-outlined',
  'clock-circle-outlined',
  'vertical-align-bottom-outlined',
  'vertical-align-top-outlined',
  'control-outlined',
  'api-outlined',
  'bars-outlined',
  'qq-outlined',
  'dollar-circle-outlined',
  'build-outlined',
  'file-add-outlined',
]
